home *** CD-ROM | disk | FTP | other *** search
- echo off
- cls
- goto :FIRST
- ───────────────────────────────────────────────────────────────────────
- Ray Bernard 903 E. 8th St. Anderson, IN 46012
- Messages care of RCN BBS South Bend, IN (219) 287-3358
- I wrote this batch file because I often make temporary directories
- on my RAM drive or hard disks. This is an easy way to add the new drive
- to the path. I keep my basic path in another batch file and use that to
- reset the path when I remove the temporary directory.
- Note: %PATH% will work from a batch file, but not on the command line.
- ───────────────────────────────────────────────────────────────────────
- :FIRST
- echo ───────────────────────────────────────────────────────────────────
- echo PATHMOD -- save, add to, restore your current path - by Ray Bernard
- echo ───────────────────────────────────────────────────────────────────
- echo
- echo Evaluating parameters . . .
- echo
- echo
- goto START
-
- :NOENTRY
- echo YOU MUST SPECIFY A PARAMETER FOR PATHADD:
- goto MESSAGE
-
- :BAD
- echo Bad PARAMETERS: %1 %2.
- echo Parameters must be entered in ALL CAPS.
- echo
-
- :MESSAGE
- echo
- ECHO Enter PATHADD ? to see documentation, or
- ECHO type or print out the PATHADD.BAT file.
- echo
- goto END
-
-
- :START
- if "%1" == "" goto NOENTRY
- if "%1" == "SEMI" goto SEMI
- if "%1" == "SAVE" goto SAVE
- if "%1" == "RESTORE" goto RESTORE
- if "%1" == "ADD" goto ADD
- if "%1" == "?" goto TYPEFILE
- goto :BAD
- :ADD
- echo %path%>>pathrec.dat
- echo Your old path was:
- echo %PATH%
- echo
- echo It has been saved in the file PATHREC.DAT.
-
- SET PATH=%PATH%%2
- echo
- echo Your new path is:
- echo %PATH%
- goto END
-
- :SAVE
- echo %path%>pathsave.dat
- echo Your current path is:
- echo %PATH%
- echo
- echo It has been saved in the file PATHSAVE.DAT.
- goto END
-
- :RESTORE
- if exist PATHSAVE.DAT goto RSTORE
- echo Could not find the file PATHSAVE.DAT to restore your former path.
- echo
- goto :END
- :RSTORE
- PATH=<PATHSAVE.DAT
- echo
- echo Your path has been restored to:
- echo %PATH%
- echo
- goto END
-
- :SEMI
- echo Adding a semicolon and specified character string to the current path:
- echo
- echo %path%>>pathrec.dat
- echo Your old path was:
- echo %PATH%
- echo
- set PATH=%PATH%;%2
- echo Path now = %PATH%
- echo
- goto END
-
- :TYPEFILE
- cls
- echo ──────────────────────────────────────────────────────────────────────────────
- echo USE PATHMOD.BAT to modify your current path.
- echo
- echo Enter PATHMOD plus a parameter at the DOS prompt as explained below.
- echo Enter Parameter commands in ALL CAPS (not required of character string).
- echo
- echo ADD characterstring
- echo - Displays current path, saves it to the file PATHSAVE.DAT,
- echo adds your character string to the path and displays new path.
- echo NOTE: DOS throws away a starting semicolon in the string.
- echo If your current path does not end with a semicolon use SEMI.
- echo
- echo SEMI characterstring
- echo - Adds semicolon plus character string to current path.
- echo
- echo SAVE
- echo - Saves the current path by adding it to the file PATHREC.DAT
- echo in the current directory. Does not change current path.
- echo
- echo RESTORE
- echo - Restores the path saved with SAVE, dislpays old and new path.
- echo ──────────────────────────────────────────────────────────────────────────────
- :END